package com.atguigu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.common.constant.MessageConstant;
import com.atguigu.common.constant.RedisMessageConstant;
import com.atguigu.common.entity.Result;
import com.atguigu.common.utils.MySMSUtils;
import com.atguigu.common.utils.RedisConstant;
import com.atguigu.pojo.Setmeal;
import com.atguigu.service.TravelSetmealService;
import com.sun.tools.javac.jvm.Code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("/setmeal")
public class MobileSetmealController {

    @Reference
    TravelSetmealService setmealService;

    @GetMapping("/getSetmeal")
    public Result getSetmeal(){
        List<Setmeal> setmeals = setmealService.getSemtealAll();
        return new Result(true, MessageConstant.QUERY_SETMEAL_SUCCESS,setmeals);
    }


    @GetMapping("/findById")
    public Result findById(@RequestParam("id")Integer id){
        Setmeal setmeal = setmealService.findById(id);
        return new Result(true,MessageConstant.QUERY_ORDER_SUCCESS,setmeal);
    }
}
